
<form id="loginform" method="post" action="servlet/LoginUser">

		<p>
		<label for="username">Username</label><br>
		<input class="biginput" type="text" id="username" name="username"/>	
		</p>
		
		<p>
		<label for="username">Password</label><br>
		<input class="biginput" type="password" id="password" name="password"/>
		</p>
		<input type="submit" id="loginbtn" name="submit" value="Login"/>
</form>
<br>
<div style="border-top: 1px #ccc dotted">
	<p style="font-size:1.3em">Not a member?</p><p><a href="/<%= request.getRequestURI().split("/")[1] %>/register" style="font-weight:bold;color:#69AD4A">Register</a> and start gathering your walnuts now.</p>
</div>

<script type="text/javascript">
	new Fudel.Form('loginform', { 
		onOK : function() {
			<% if (request.getParameter("p").equals("login.jsp")) { %>
				Fudel.redirect('/<%= request.getRequestURI().split("/")[1] %>','servlet/Profiler?nextp=login');
			<%} else {%>
				Fudel.redirect('/<%= request.getRequestURI().split("/")[1] %>','servlet/Profiler?nextp=<%= request.getParameter("p").split("\\.")[0] %>');
			<%}%>
		},
		onError : function(obj) {
			alert(obj.ERROR);
		}
	});
</script>
